# 创建列表，包含1-100之间的所有数
l = [x for x in range(0, 100)]
# print(l)


# 输出偶数
l = [x for x in range(0, 100) if x % 2 == 0]
# print(l)


# 得到一个元素平方的列表
# alist = [1, 2, 3, 4, 5, 6, 7]
# blist = [x ** 2 for x in alist]
# print(blist)

# 得到新列表：a和b对应位置元素和的平方
alist = [1, 2, 3, 4]
blist = [5, 6, 7, 8]
newList = [(x + y) ** 2 for x, y in zip(alist, blist)]
# print(newList)



# 添加商品
val =""
goods = ["商品1", "商品2", "商品3", "商品4", "商品5"]
goodsCar=[]
while val != "q":
    val = int(input("选择需要的商品编号，输入q结束"))
    goodsCar = goods.append(goods.index(val))
print(goodsCar)
